Skip to content

feat(sdk): add LangGraph ToolNode integration#104

Draft
lan17 wants to merge 5 commits intomainfrom
codex/langgraph-toolnode-integration
Draft

feat(sdk): add LangGraph ToolNode integration#104
lan17 wants to merge 5 commits intomainfrom
codex/langgraph-toolnode-integration

Conversation

@lan17
Copy link
Contributor

@lan17 lan17 commented Mar 11, 2026

Summary

  • add an optional agent_control.integrations.langgraph package with lazy imports and a langgraph extra
  • add create_controlled_tool_node(...) using LangGraph's public ToolNode wrapper seams with Agent Control registration, refresh, and policy evaluation
  • add a sibling agent_control.integrations.langchain.AgentControlMiddleware for LangChain agent-factory middleware integration, backed by the same shared tool-control runtime
  • add focused unit coverage for lazy imports, registration behavior, sync/async execution, and deny/steer handling across both integration surfaces
  • add a minimal LangGraph smoke example and setup script for local validation against a live server

Closes #72.

Testing

  • uv run --package agent-control pytest sdks/python/tests/test_langgraph_init.py sdks/python/tests/test_langgraph_tool_node.py sdks/python/tests/test_langchain_init.py sdks/python/tests/test_langchain_middleware.py
  • make sdk-lint
  • make sdk-typecheck
  • uv run python -m py_compile examples/langchain/setup_langgraph_toolnode_controls.py examples/langchain/langgraph_toolnode_integration_smoke.py
  • uv run ruff check examples/langchain/setup_langgraph_toolnode_controls.py examples/langchain/langgraph_toolnode_integration_smoke.py

Notes

  • make sdk-test was not run because the local SDK test harness expects Postgres on localhost:5432.
  • LangChain middleware applies when tool execution flows through LangChain's agent factory. Raw StateGraph / ToolNode usage still needs the LangGraph integration surface.

@lan17 lan17 changed the title feat: add LangGraph ToolNode integration feat(sdk): add LangGraph ToolNode integration Mar 11, 2026
@lan17 lan17 marked this pull request as draft March 11, 2026 19:56
@lan17 lan17 marked this pull request as draft March 11, 2026 19:56
@lan17 lan17 marked this pull request as draft March 11, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LangGraph integration

1 participant